package com.gis3c.sys.dao;

import com.gis3c.sys.entry.po.Role;
import com.gis3c.sys.entry.po.Token;
import com.gis3c.sys.entry.po.User;

import java.util.List;
import java.util.Map;

public interface UserDao {
	public User createUser(User user);
	public void updateUser(User user);
	public int deleteUser(String userId);
	public int deleteUsers(String[] userIds);
	public void changePassword(String userId, String newPassword,String newSalt);

	public User findOne(String userId);
	
	public User findByUsername(String username);
	public int userCount(String username);
	
	public List<User> allUsers();
	public List<User> allUsersByPage(int pagesize, int currentpage);
	public int allUsersCount();


	
	public List<String> findPermissions(String username);
	
	public void correlationOrg(String userId, String orgId);
    public void uncorrelationOrg(String userId);
	public List<User> findUsersByOrgId(String orgId);

	public Token findTokenByUserId(String userId);
    public List<Map<String,Object>> getUserWithToken(String userId);
    public int updateToken(Token token);
    public int createToken(Token token);
    public boolean exitToken(String userId);
    public int deleteToken(String userId);
	public String getUserNameByToken(String token);
	public String getTokenByUserName(String userName);
	public void updateTokeTime(String tokenStr);
    
    public String findsecretByUserName(String userName);
}
